<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="violationRecordId" value="#{violationRecordHome.id}"></f:viewParam>
	   	<f:event listener="#{violationRecordHome.initConversation()}" type="preRenderView"></f:event>
	   		   	
	   	<f:viewParam name="moduleName" value="日常考核管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="查看日常考核记录" style="margin-bottom:10px;">
		        
		        <h:panelGrid columns="2" cellpadding="5">
					<p:outputLabel value="中介机构" />
					<h:outputText value="#{violationRecordHome.instance.serviceSupplier.cnname}" />
						   
				    <p:outputLabel value="考核类别" />			
				    <h:outputText value="#{approvedClassHome.instance.name}" />
					
					<p:outputLabel value="考核事项" />
					<h:outputText value="#{violationRecordHome.instance.approvedMatter.matterName}" />					
					
					<p:outputLabel value="考核时间"></p:outputLabel>
					<h:outputText value="#{violationRecordHome.instance.occurrenceTime}">
						<f:convertDateTime pattern="yyyy-MM-dd"/>
					</h:outputText>		
										
					<p:outputLabel value="事实描述"></p:outputLabel>
					<h:outputText value="#{violationRecordHome.instance.desc}" />		
					
				</h:panelGrid>
			</p:panel>
			
			<p:panel id="evidencesPanel" header="证据材料">
				<p:panelGrid>
					
					<p:repeat var="_evidence" value="#{violationRecordHome.instance.evidences}">
						<p:row>
							<p:column>
								<div style="width: 100px; margin: 0;">
									<p:outputLabel value="#{_evidence.defination.name}"></p:outputLabel>
								</div>								
							</p:column>
							<p:column>
								<p:dataList var="_attr" value="#{_evidence.attachments}">
									<p:commandButton style="margin-left:10px;" ajax="false"  icon="ui-icon-arrowthick-1-s">
								        <p:fileDownload value="#{fileDownloadView.download(_attr)}" />
								        <h:outputText value="#{_attr.filename}" />
								    </p:commandButton>									
								</p:dataList>								
							</p:column>
						</p:row>
					</p:repeat>
					
				</p:panelGrid>				
			</p:panel>
			
			<p:commandButton action="#{violationRecordHome.cancel()}" value="返回" immediate="true"></p:commandButton>	
		</h:form>
        
   	</ui:define>
</ui:composition>
